package edu.gtcfla.km.repositories;

import java.io.Serializable;
import java.util.Collection;
import java.util.Map;
import java.util.Set;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.Repository;
import org.vsg.biz.account.User;

import edu.gtcfla.km.UserGroup;

public interface UserGroupRepo<T extends UserGroup, ID extends Serializable> extends Repository<T, ID> {

	void save(T entity);
	
	void update(T entity);
	
	void deleteFully(T entity);
	
	void updateAll(Collection<T> entities);	
	
	T findOne(ID primaryKey);
	
	T loadOne(ID primaryKey);
	
	
	
	T findFirstOneByUserId(String userId);
	
	Set<T> findAllByUserId(String userId);
	
	T findParent( ID primaryKey );	

	Map<String , T> findAllMap();

	Map<String , T> findAllMap(String query);	
	
	Map<String , T> findAllByIds(Set<String> ids);

	Page<T> pageAviableUserGroup(Pageable pageable);
	
	
	Set<User> findMembersByGroupId(String groupId);
	
	
	void assignMembersToUserGroup(Set<String> newMemberIds , String groupId);
	
	
}
